<?php  if (!defined("IS_INITPHP")) exit("Access Denied!");  /* INITPHP Version 1.0 ,Create on 2014-01-24 08:37:56, compiled from ../app/web/template/operations.htm */ ?>
  <style type="text/css">
    table td {text-align:center;}
    table td input {width:80%;}
  </style>
<script type="text/javascript">
var counter = 1;
function add_one()
{
	var tbl = $('#alltbl');
	var tr = $('#alltbltitle');
	
	var s = '<tr>';
	s +='<td><input type="text" size="10" name="new['+counter+'][op_name]" value="" /></td>';
  	s +='<td><input type="text" size="10" name="new['+counter+'][op_remark]" value="" /></td>';
  	s +='<td><input type="text" size="4" name="new['+counter+'][op_sort]" value="" /></td>';
  	s +='</tr>';
	$(s).insertAfter(tr);
	
	counter++;
}

$(document).ready(function(){
    $('tr').mouseover(function(){
        $(this).children().css('background-color', '#ffff99');
    }).mouseout(function(){
        $(this).children().css('background-color', '');
    });
});

</script>

<p>
[操作库]使用说明
<ol>
    <li>点击“增加”按钮，可新增记录</li>
    <li>新增或修改记录后，点击“提交”按钮，即可</li>
    <li>清空“编码”字段，再“提交”，即可删除</li>
</ol>
</p>

<form action="<?php echo $actionurl;?>" method="post">
<input type="button" value="增加" onclick="add_one()" />
<input type="submit" value="提交" />
<table width="100%" border="1" id="alltbl">
	<tr id="alltbltitle">
		<th>编码</th>
		<th>描述</th>
		<th>排序</th>
	</tr>
  <?php foreach  ($bases as $val) { ?>
  <tr>
  		<td><input type="text" size="10" name="old[<?php echo $val[op_id];?>][op_name]" value="<?php echo $val[op_name];?>" /></td>
  		<td><input type="text" size="10" name="old[<?php echo $val[op_id];?>][op_remark]" value="<?php echo $val[op_remark];?>" /></td>
  		<td><input type="text" size="4" name="old[<?php echo $val[op_id];?>][op_sort]" value="<?php echo $val[op_sort];?>" /></td>
  </tr>
  <?php } ?>
</table>
</form>